import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import './assets/fonts/iconfont.css'
// 引入过滤器文件
import * as filters from './filters/index'
import axios from 'axios'
axios.defaults.baseURL = 'http://192.168.124.131:8888/api/private/v1/'
//配置请求头信息
axios.interceptors.request.use(config => {
  //在请求头中添加一个字段Authorization 值为授权值
  config.headers.Authorization = window.sessionStorage.getItem('token')
  console.log(config)
  return config
})
Vue.prototype.$http = axios

Vue.config.productionTip = false

// 过滤器注册
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
